package com.umeox.watch.moto.dataservice.mqtt.request;


import com.alibaba.fastjson.JSONObject;
import com.umeox.moto.mqtt.request.MqttPublishRequest;

public class AckPushMsgRequest extends MqttPublishRequest {


    public AckPushMsgRequest(String topic, JSONObject params){
        this.topic = topic;
        this.requestId = getRequestId(topic);
        this.payloadObj = params.toString();
        this.isRPC = false;
        this.qos = 0;
    }

    private String getRequestId(String topic) {
        int index = topic.lastIndexOf("/");
        return topic.substring(index + 1);
    }
}
